<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function addText(){
				var df = document.createDocumentFragment()
				for (var i = 0; i < 10; i++) {
					let div=document.createElement("div")
					div.innerHTML="文字节点"
					df.appendChild(div)
						}
				document.querySelector(".con").appendChild(df)
			}
			function addImage(){
				var df = document.createDocumentFragment()
				for (var i = 0; i < 10; i++) {
					let img=document.createElement("img")
					img.setAttribute("src","../src/ok.png")
					df.appendChild(img)
						}
				document.querySelector(".con").appendChild(df)
			}
		</script>
	</head>
	<body>
		<button onclick="addText()">添加十个文本</button>
		<button onclick="addImage()">添加十个图片</button>
		<div class="con"></div>
	</body>
</html>

